\hypertarget{classduye_1_1_xml_base}{\section{duye\-:\-:Xml\-Base Class Reference}
\label{classduye_1_1_xml_base}\index{duye\-::\-Xml\-Base@{duye\-::\-Xml\-Base}}
}


\hyperlink{classduye_1_1_xml_base}{Xml\-Base} is a base class for every class in Gny\-Xml. It does little except to establish that Gny\-Xml classes can be printed and provide some utility functions.  




{\ttfamily \#include $<$duye\-\_\-xml.\-h$>$}

Inheritance diagram for duye\-:\-:Xml\-Base\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classduye_1_1_xml_base}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \{ \\*
{\bfseries X\-M\-L\-\_\-\-N\-O\-\_\-\-E\-R\-R\-O\-R} = 0, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-O\-P\-E\-N\-I\-N\-G\-\_\-\-F\-I\-L\-E}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-E\-L\-E\-M\-E\-N\-T}, 
\\*
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-F\-A\-I\-L\-E\-D\-\_\-\-T\-O\-\_\-\-R\-E\-A\-D\-\_\-\-E\-L\-E\-M\-E\-N\-T\-\_\-\-N\-A\-M\-E}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-R\-E\-A\-D\-I\-N\-G\-\_\-\-E\-L\-E\-M\-E\-N\-T\-\_\-\-V\-A\-L\-U\-E}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-R\-E\-A\-D\-I\-N\-G\-\_\-\-A\-T\-T\-R\-I\-B\-U\-T\-E\-S}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-E\-M\-P\-T\-Y}, 
\\*
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-R\-E\-A\-D\-I\-N\-G\-\_\-\-E\-N\-D\-\_\-\-T\-A\-G}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-U\-N\-K\-N\-O\-W\-N}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-C\-O\-M\-M\-E\-N\-T}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-D\-E\-C\-L\-A\-R\-A\-G\-O\-N}, 
\\*
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-D\-O\-C\-U\-M\-E\-N\-T\-\_\-\-E\-M\-P\-T\-Y}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-E\-M\-B\-E\-D\-D\-E\-D\-\_\-\-N\-U\-L\-L}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-P\-A\-R\-S\-I\-N\-G\-\_\-\-C\-D\-A\-T\-A}, 
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-D\-O\-C\-U\-M\-E\-N\-T\-\_\-\-T\-O\-P\-\_\-\-O\-N\-L\-Y}, 
\\*
{\bfseries X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-S\-T\-R\-I\-N\-G\-\_\-\-C\-O\-U\-N\-T}
 \}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classduye_1_1_xml_base_aeb28d8aeec84aad3ce290c6cc3a5ec06}{print} (F\-I\-L\-E $\ast$cfile, int depth) const =0
\begin{DoxyCompactList}\small\item\em All Gny\-Xml classes can print themselves to a filestream or the string class (G\-Xml\-String in non-\/\-S\-T\-L mode, std\-::string in S\-T\-L mode.) Either or both cfile and str can be null. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a3e3b595a200a6623630501244c6638e1}{virtual void {\bfseries xml\-To\-Str} (std\-::string \&out\-Xml, int depth) const =0}\label{classduye_1_1_xml_base_a3e3b595a200a6623630501244c6638e1}

\item 
int \hyperlink{classduye_1_1_xml_base_abd456d36d5f4362bfb8405e4f9fa8334}{row} () const 
\item 
\hypertarget{classduye_1_1_xml_base_a2fe47c66f1c19b535d7a935e906654c0}{int \hyperlink{classduye_1_1_xml_base_a2fe47c66f1c19b535d7a935e906654c0}{column} () const }\label{classduye_1_1_xml_base_a2fe47c66f1c19b535d7a935e906654c0}

\begin{DoxyCompactList}\small\item\em See Row() \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a1650d1d2f5b74d58441a1f44994fd3cb}{void \hyperlink{classduye_1_1_xml_base_a1650d1d2f5b74d58441a1f44994fd3cb}{set\-User\-Data} (void $\ast$user)}\label{classduye_1_1_xml_base_a1650d1d2f5b74d58441a1f44994fd3cb}

\begin{DoxyCompactList}\small\item\em Set a pointer to arbitrary user data. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_ae1414fc996e956dd296b77cea25fc959}{void $\ast$ \hyperlink{classduye_1_1_xml_base_ae1414fc996e956dd296b77cea25fc959}{get\-User\-Data} ()}\label{classduye_1_1_xml_base_ae1414fc996e956dd296b77cea25fc959}

\begin{DoxyCompactList}\small\item\em Get a pointer to arbitrary user data. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a0fa2e4be3e635011c3aea94c2a9bbd10}{const void $\ast$ \hyperlink{classduye_1_1_xml_base_a0fa2e4be3e635011c3aea94c2a9bbd10}{get\-User\-Data} () const }\label{classduye_1_1_xml_base_a0fa2e4be3e635011c3aea94c2a9bbd10}

\begin{DoxyCompactList}\small\item\em Get a pointer to arbitrary user data. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_aaba8e1cbc76fd361198f4d42996d1c7b}{virtual const char $\ast$ {\bfseries parse} (const char $\ast$p, Xml\-Parsing\-Data $\ast$data, Xml\-Encoding encoding)=0}\label{classduye_1_1_xml_base_aaba8e1cbc76fd361198f4d42996d1c7b}

\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a2f278b32e215015c37f067c37cbf7b8e}{static void \hyperlink{classduye_1_1_xml_base_a2f278b32e215015c37f067c37cbf7b8e}{set\-Condense\-White\-Space} (bool condense)}\label{classduye_1_1_xml_base_a2f278b32e215015c37f067c37cbf7b8e}

\begin{DoxyCompactList}\small\item\em The world does not agree on whether white space should be kept or not. In order to make everyone happy, these global, static functions are provided to set whether or not Gny\-Xml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_ab58f4134b1a9f5ffca01c7ba6ef7fde3}{static bool \hyperlink{classduye_1_1_xml_base_ab58f4134b1a9f5ffca01c7ba6ef7fde3}{is\-White\-Space\-Condensed} ()}\label{classduye_1_1_xml_base_ab58f4134b1a9f5ffca01c7ba6ef7fde3}

\begin{DoxyCompactList}\small\item\em Return the current white space setting. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a7324491537ebb8bf1350d6b728ebbe77}{static void \hyperlink{classduye_1_1_xml_base_a7324491537ebb8bf1350d6b728ebbe77}{encode\-String} (const std\-::string \&str, std\-::string $\ast$out)}\label{classduye_1_1_xml_base_a7324491537ebb8bf1350d6b728ebbe77}

\begin{DoxyCompactList}\small\item\em Expands entities in a string. Note this should not contian the tag's '$<$', '$>$', etc, or they will be transformed into entities! \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a36568795fbf40e1762415fc9046a341b}{static const int {\bfseries m\-\_\-utf8\-Byte\-Table} \mbox{[}256\mbox{]}}\label{classduye_1_1_xml_base_a36568795fbf40e1762415fc9046a341b}

\end{DoxyCompactItemize}
\subsection*{Static Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a1f18bba2c1231643cf32ea64cc28a4d3}{static const char $\ast$ {\bfseries skip\-White\-Space} (const char $\ast$, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a1f18bba2c1231643cf32ea64cc28a4d3}

\item 
\hypertarget{classduye_1_1_xml_base_af7daf7b3d7cf1fd84947cc34a515a022}{static bool {\bfseries is\-White\-Space} (char c)}\label{classduye_1_1_xml_base_af7daf7b3d7cf1fd84947cc34a515a022}

\item 
\hypertarget{classduye_1_1_xml_base_ac979b9de5faf98bed740d76ee413a2ff}{static bool {\bfseries is\-White\-Space} (int c)}\label{classduye_1_1_xml_base_ac979b9de5faf98bed740d76ee413a2ff}

\item 
\hypertarget{classduye_1_1_xml_base_a6277cd70ad00dc1305de4315863baa13}{static bool {\bfseries stream\-White\-Space} (std\-::istream $\ast$in, std\-::string $\ast$tag)}\label{classduye_1_1_xml_base_a6277cd70ad00dc1305de4315863baa13}

\item 
\hypertarget{classduye_1_1_xml_base_aefc31a6c24cb50fceaf696046bce811e}{static bool {\bfseries stream\-To} (std\-::istream $\ast$in, int character, std\-::string $\ast$tag)}\label{classduye_1_1_xml_base_aefc31a6c24cb50fceaf696046bce811e}

\item 
\hypertarget{classduye_1_1_xml_base_a5ebf61d90446334388e399c00aa56b68}{static const char $\ast$ \hyperlink{classduye_1_1_xml_base_a5ebf61d90446334388e399c00aa56b68}{read\-Name} (const char $\ast$p, std\-::string $\ast$name, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a5ebf61d90446334388e399c00aa56b68}

\begin{DoxyCompactList}\small\item\em Reads an X\-M\-L name into the string provided. Returns a pointer just past the last character of the name, or 0 if the function has an error. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a6c6920f167a01923f80d1a36a63cbd88}{static const char $\ast$ \hyperlink{classduye_1_1_xml_base_a6c6920f167a01923f80d1a36a63cbd88}{read\-Text} (const char $\ast$in, std\-::string $\ast$text, bool ignore\-White\-Space, const char $\ast$end\-Tag, bool ignore\-Case, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a6c6920f167a01923f80d1a36a63cbd88}

\begin{DoxyCompactList}\small\item\em Reads text. Returns a pointer past the given end tag. Wickedly complex options, but it keeps the (sensitive) code in one place. \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_xml_base_a39e00e714b5bb950d2578609bf024dc7}{static const char $\ast$ {\bfseries get\-Entity} (const char $\ast$in, char $\ast$value, int $\ast$length, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a39e00e714b5bb950d2578609bf024dc7}

\item 
\hypertarget{classduye_1_1_xml_base_a0f9b7daa58e6a9142c5c96f4243ac4d8}{static const char $\ast$ {\bfseries get\-Char} (const char $\ast$p, char $\ast$value, int $\ast$length, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a0f9b7daa58e6a9142c5c96f4243ac4d8}

\item 
\hypertarget{classduye_1_1_xml_base_a112c9a866ce15d43833c3f7834b01cb8}{static bool {\bfseries string\-Equal} (const char $\ast$p, const char $\ast$end\-Tag, bool ignore\-Case, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a112c9a866ce15d43833c3f7834b01cb8}

\item 
\hypertarget{classduye_1_1_xml_base_a9fe6a26a79bc555560f5ab26a5c7e2c1}{static int {\bfseries is\-Alpha} (unsigned char any\-Byte, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a9fe6a26a79bc555560f5ab26a5c7e2c1}

\item 
\hypertarget{classduye_1_1_xml_base_a11a4347c5eec52d4b95eae1a7522e171}{static int {\bfseries is\-Alpha\-Num} (unsigned char any\-Byte, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_a11a4347c5eec52d4b95eae1a7522e171}

\item 
\hypertarget{classduye_1_1_xml_base_ada2d4f2b852941873b04195b167a4bbe}{static int {\bfseries to\-Lower} (int v, Xml\-Encoding encoding)}\label{classduye_1_1_xml_base_ada2d4f2b852941873b04195b167a4bbe}

\item 
\hypertarget{classduye_1_1_xml_base_a0581f285b4e0d29a430abf78dfe5f774}{static void {\bfseries convert\-U\-T\-F32\-To\-U\-T\-F8} (unsigned long input, char $\ast$output, int $\ast$length)}\label{classduye_1_1_xml_base_a0581f285b4e0d29a430abf78dfe5f774}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a290d275fee62c93df204dfa041b7c657}{\hyperlink{classduye_1_1_xml_cursor}{Xml\-Cursor} {\bfseries m\-\_\-location}}\label{classduye_1_1_xml_base_a290d275fee62c93df204dfa041b7c657}

\item 
\hypertarget{classduye_1_1_xml_base_aba0ab14e19dc483be84e5e11c65150b8}{void $\ast$ \hyperlink{classduye_1_1_xml_base_aba0ab14e19dc483be84e5e11c65150b8}{m\-\_\-user\-Data}}\label{classduye_1_1_xml_base_aba0ab14e19dc483be84e5e11c65150b8}

\begin{DoxyCompactList}\small\item\em Field containing a generic user pointer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a1592ff499a7e4cbc364e2e5a7bc809e0}{static const char $\ast$ {\bfseries m\-\_\-error\-String} \mbox{[}X\-M\-L\-\_\-\-E\-R\-R\-O\-R\-\_\-\-S\-T\-R\-I\-N\-G\-\_\-\-C\-O\-U\-N\-T\mbox{]}}\label{classduye_1_1_xml_base_a1592ff499a7e4cbc364e2e5a7bc809e0}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_xml_base_a88b009b38305b720f82e3bfc4695b70f}{class {\bfseries Xml\-Node}}\label{classduye_1_1_xml_base_a88b009b38305b720f82e3bfc4695b70f}

\item 
\hypertarget{classduye_1_1_xml_base_abedc393b34ee7d5d9558e7736cc0f032}{class {\bfseries Xml\-Element}}\label{classduye_1_1_xml_base_abedc393b34ee7d5d9558e7736cc0f032}

\item 
\hypertarget{classduye_1_1_xml_base_acb499a895285d52060e9d6f2d937d383}{class {\bfseries Xml\-Document}}\label{classduye_1_1_xml_base_acb499a895285d52060e9d6f2d937d383}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classduye_1_1_xml_base}{Xml\-Base} is a base class for every class in Gny\-Xml. It does little except to establish that Gny\-Xml classes can be printed and provide some utility functions. 

In X\-M\-L, the document and elements can contain other elements and other types of nodes.

\begin{DoxyVerb}* A Document can contain:   Element (container or leaf)
* Comment (leaf)
* Unknown (leaf)
* Declaration( leaf )
* 
* An Element can contain:   Element (container or leaf)
* Text  (leaf)
* Attributes (not on tree)
* Comment (leaf)
* Unknown (leaf)
* 
* A Decleration contains: Attributes (not on tree)
* \end{DoxyVerb}
 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_xml_base_aeb28d8aeec84aad3ce290c6cc3a5ec06}{\index{duye\-::\-Xml\-Base@{duye\-::\-Xml\-Base}!print@{print}}
\index{print@{print}!duye::XmlBase@{duye\-::\-Xml\-Base}}
\subsubsection[{print}]{\setlength{\rightskip}{0pt plus 5cm}virtual void duye\-::\-Xml\-Base\-::print (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{cfile, }
\item[{int}]{depth}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{classduye_1_1_xml_base_aeb28d8aeec84aad3ce290c6cc3a5ec06}


All Gny\-Xml classes can print themselves to a filestream or the string class (G\-Xml\-String in non-\/\-S\-T\-L mode, std\-::string in S\-T\-L mode.) Either or both cfile and str can be null. 

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the $<$$<$ operator.) 

Implemented in \hyperlink{classduye_1_1_xml_document_a6e47f2b7dc26ead234b5d6672fdebbf1}{duye\-::\-Xml\-Document}, \hyperlink{classduye_1_1_xml_unknown_a6f6a15c642fdf66a94b0f77afe27a599}{duye\-::\-Xml\-Unknown}, \hyperlink{classduye_1_1_xml_declaration_a3e3a634a7c060253d6f38a28213639b9}{duye\-::\-Xml\-Declaration}, \hyperlink{classduye_1_1_xml_text_a5354f8e3a2b2169125ee308fced53a20}{duye\-::\-Xml\-Text}, \hyperlink{classduye_1_1_xml_comment_ab761b076aa5e712eb2e22dd3f79ab8c9}{duye\-::\-Xml\-Comment}, \hyperlink{classduye_1_1_xml_element_a046112fa85b80dd1c09546dda19afe42}{duye\-::\-Xml\-Element}, and \hyperlink{classduye_1_1_xml_attribute_a76fde61930196859780ba4e63c4f57ef}{duye\-::\-Xml\-Attribute}.

\hypertarget{classduye_1_1_xml_base_abd456d36d5f4362bfb8405e4f9fa8334}{\index{duye\-::\-Xml\-Base@{duye\-::\-Xml\-Base}!row@{row}}
\index{row@{row}!duye::XmlBase@{duye\-::\-Xml\-Base}}
\subsubsection[{row}]{\setlength{\rightskip}{0pt plus 5cm}int duye\-::\-Xml\-Base\-::row (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classduye_1_1_xml_base_abd456d36d5f4362bfb8405e4f9fa8334}
Return the position, in the original source file, of this node or attribute. The row and column are 1-\/based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.

Generally, the row and column value will be set when the G\-Xml\-Document\-::\-Load(), G\-Xml\-Document\-::\-Load\-File(), or any Xml\-Node\-::\-Parse() is called. It will N\-O\-T be set when the D\-O\-M was created from operator$>$$>$.

The values reflect the initial load. Once the D\-O\-M is modified programmatically (by adding or changing nodes and attributes) the new values will N\-O\-T update to reflect changes in the document.

There is a minor performance cost to computing the row and column. Computation can be disabled if G\-Xml\-Document\-::\-Set\-Tab\-Size() is called with 0 as the value.

\begin{DoxySeeAlso}{See Also}
G\-Xml\-Document\-::\-Set\-Tab\-Size() 
\end{DoxySeeAlso}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/utils/duye\-\_\-xml.\-h\end{DoxyCompactItemize}
